extends layout

block content
  div.printOut(style="text-align:center;")
    h1= title
    p Welcome to 搜索公众号#{title}
  br
  div.printOut
    label#page-exp 页码
    input(type="number" class="form-control" id="page" value="1" min="1" max="10" placeholder="当前页码")
    input(type="text" class="form-control" id="openid" placeholder="公众号openid")
    input#getData-btn.btn.btn-success(type='button', value='获取数据')
  div(style="clear:both;")
  br
  br
  br
  div#printOut.printOut
  div#returnHome.return-home
    a(href="/weixin/") 返回


  script(type='text/javascript').
    $(document).ready(function(){
      $('#openid').val(window.localStorage.getItem('openid'));
      //获取公众号新闻数据
      var getBtn = $('#getData-btn');
      var openid = window.localStorage.getItem('openid');
      getBtn.on('click', getGZHnews);
      if($('#openid').val() == openid){
        getGZHnews();
      }

    });

